package com.zr.Inquiry.meiju;

/**
 * Created by Liyiding on 2019/9/28.
 */
public enum IsTaxEnum {
    HANSHUI(0,"不含税"),BUHANSHUI(1,"含税");

    private final String isTaxName;
    private final Integer isTaxValue;

    private IsTaxEnum(Integer isTaxValue, String isTaxName)
    {
        this.isTaxName = isTaxName;
        this.isTaxValue = isTaxValue;
    }

    // 通过值取名称
    public static String getName(int isTaxValue) {
        for (IsTaxEnum i : IsTaxEnum.values()) {
            if (i.getIsTaxValue() == isTaxValue) {
                return i.isTaxName;
            }
        }

        return null;
    }
    // 通过名称取值
    public static Integer getValue(String isTaxName) {
        for (IsTaxEnum i : IsTaxEnum.values())
            if (i.getIsTaxName().equals(isTaxName)) {
                return i.getIsTaxValue();
            }
        return null;
    }

    public String getIsTaxName() {
        return isTaxName;
    }

    public Integer getIsTaxValue() {
        return isTaxValue;
    }
}
